/**
 * Created by 王健 on 2017/3/12.
 */


function GetQueryString(name)
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}
function client_storage(key, val) {
    if (!window.localStorage) {
        return;
    }
    if (!key) {
        return;
    }
    if (key && val === undefined) {
        return window.localStorage[key];
    }

    if (key && val !== undefined) {
        if (typeof val != 'string' && typeof val != 'number') {
            alert("ttjd_client_storage 只能保存字符串");
            return;
        }
        window.localStorage[key] = val;
    }
};
var baseConfig = {
    is_phone:true,
    // host:'http://www.mmggoo.com',
    host:'http://0.0.0.0:8802',
    // host:'http://192.168.1.193:8802',
    qn_host: 'http://static2.mmggoo.com/',
    page_back:function () {
        history.go(-1);
        setTimeout(function () {
            ttjd.close_phonegap();
        }, 200);
    }
}


window.show_head_img = function (img_url, parm) {
    if(img_url&&img_url.indexOf(baseConfig.qn_host)>=0){
        if(img_url.indexOf("?")>0){
            return img_url + parm;
        }else{
            return img_url + "?" + parm;
        }

    }else{
        return img_url;
    }
}